
#include "OptionsRequest.h"

OptionsRequest::OptionsRequest() {
	method = "OPTIONS";
	uri = "";
	version = "HTTP/1.1";
}

OptionsRequest::OptionsRequest(stringstream& s) : Request(s) 
{ //runs Request(s) logic, then GetRequest(s) logic
        method = "OPTIONS";
}

OptionsRequest OptionsRequest::operator =(OptionsRequest& rhs) {
	method = rhs.method;
	uri  = rhs.uri;
	version = rhs.version;
	headers = rhs.headers; // May need to iterate through headers and add in items.
	return *this;
}
Response OptionsRequest::processRequest()
{
    Response resp;
    resp.statusCode = "200";
    resp.reasonPhrase = "OK";
    resp.headers << "Allow: OPTIONS,POST,HEAD,GET,DELETE\r\n";
    resp.MakeHeader();
    return resp;
}
void OptionsRequest::PrintInfo()
{
    Request::PrintInfo();
}
